import * as React from 'react';
import {
  Switch,
  Route,
  BrowserRouter,
  HashRouter,
  Link,
} from 'react-router-dom';

const Home: React.FC<any> = (props: any) => {
  console.log(props);
  return (
    <div>
      <h2>Home</h2>
    </div>
  );
};
const Abort: React.FC<any> = (props: any) => {
  console.log(props);
  return (
    <div>
      <h2>Abort</h2>
    </div>
  );
};

const Index: React.FC<any> = (props: any) => {
  console.log(props);
  return (
    <HashRouter>
      <div>
        <Link to="/home">to Home</Link>
        <hr/>
        <Link to="/abort">to Abort</Link>
      </div>
      <div>
        <Switch>
          <Route exact path="/home" component={Home}></Route>
          <Route exact path="/abort" component={Abort}></Route>
        </Switch>
      </div>
    </HashRouter>
  );
};

export default Index;